package com.uglygeeker.service.impl;


import com.uglygeeker.common.mybatis.BaseServiceImpl;
import com.uglygeeker.entity.User;
import com.uglygeeker.mapper.UserMapper;
import com.uglygeeker.service.IUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;
import tk.mybatis.mapper.common.Mapper;

/**
 * Created by tanxw on 2017/3/30.
 */
@Service
public class UserServiceImpl extends BaseServiceImpl<User> implements IUserService {

    @Autowired
    private UserMapper userMapper;

    @Override
    public Mapper<User> getMapper() {
        return super.getMapper();
    }

    @Override
    @Cacheable(value = "common",unless = "#result == null")
    public User getUserInfo(){
        User user=userMapper.findUserInfo();
        //User user=null;
        return user;
    }
}
